﻿@using Shp.Web.Controllers;

<div class="clearfix">
    <div class="sf-menu-cntr-out" style="float: right; margin: 0 20px 30px 20px; padding-left: 0;">
@Html.MvcContrib().Menu(settings => {
    settings.RootMenuContainerClass = "sf-menu solo";
    settings.FirstRootMenuItemClass = "sf-first";
    settings.LastRootMenuItemClass = "sf-last";
}).Items(menu => {    

    if (Request.IsAuthenticated) {
        menu.Secure<AccountController>(c => c.ChangePassword(), null, Url.Content("~/Content/ico/application_key.png"));
        menu.Secure<AccountController>(c => c.LogOff(), null, Url.Content("~/Content/ico/application_go.png")); 
    }
    else {
        menu.Action<AccountController>(c => c.Register(), "Register", Url.Content("~/Content/ico/application_form.png")); 
        menu.Action<AccountController>(c => c.MagicLogOn(), null, Url.Content("~/Content/ico/key.png")); 
    }    
})
    </div>
</div>

<div class="sf-menu-cntr-out">
@Html.MvcContrib().Menu().Items(menu => {
     menu.Action<HomeController>(c => c.Index(), "no text displayed", Url.Content("~/Content/ico/house.png"))
        .ItemAttributes(@class => "solo").DisplayText(false);
    
    menu.Link("MvcContrib", null, Url.Content("~/Content/ico/application_side_boxes.png")).Items(sub => {
        sub.Content(
            @:@Html.Partial("_MvcContribLogo")    
        );
    }).ListAttributes(style => "width: 450px;", @class => "sf-shadow-off");

    menu.Link("Secure", null, Url.Content("~/Content/ico/lock_open.png")).Items(sub => {
        sub.Secure<HomeController>(c => c.Index(), null, Url.Content("~/Content/ico/application_view_tile.png"));
        sub.Secure<HomeController>(c => c.About(), null, Url.Content("~/Content/ico/info2.png"));
        sub.Secure<HomeController>(c => c.SecurePageOne(), null, Url.Content("~/Content/ico/shield.png"));
        sub.Secure<HomeController>(c => c.SecurePageTwo(), null, Url.Content("~/Content/ico/shield_go.png"));
    });

    menu.Link("Insecure", null, Url.Content("~/Content/ico/lock.png")).Items(sub => {
        sub.Action<HomeController>(c => c.Index(), null, Url.Content("~/Content/ico/application_view_tile.png"));
        sub.Action<HomeController>(c => c.About(), null, Url.Content("~/Content/ico/info2.png"));
        sub.Action<HomeController>(c => c.SecurePageOne(), null, Url.Content("~/Content/ico/shield.png"));
        sub.Action<HomeController>(c => c.SecurePageTwo(), null, Url.Content("~/Content/ico/shield_go.png"));
    });

    menu.Link("Grid Examples", null, Url.Content("~/Content/ico/table.png")).Items(sub => {
        sub.Action<GridController>(c => c.ContribGrid(null, null), "Out-of-the-box", Url.Content("~/Content/ico/table_go.png"));
        sub.Action<GridController>(c => c.ThemedGrid(null, null, null), "Themed", Url.Content("~/Content/ico/table_sort.png"));
        sub.Action<GridController>(c => c.LocalThemedGrid(null, null, null), "Themed - Local", Url.Content("~/Content/ico/table_sort.png"));
        sub.Action<GridController>(c => c.EmptyThemedGrid(null, null, null), "Empty Themed", Url.Content("~/Content/ico/table_row_delete.png"));
        sub.Action<GridController>(c => c.SmallThemedGrid(null, null, null), "Single Page", Url.Content("~/Content/ico/table_row_insert.png"));
    });

    menu.Link("Menu Examples", null, Url.Content("~/Content/ico/ipod.png")).Items(sub => {
        sub.Link("Mega-Menus", null, Url.Content("~/Content/ico/application_view_gallery.png")).Items(sub0 => {
            sub0.Action<MenuController>(c => c.MegaMenu(), "Mega-Menu", Url.Content("~/Content/ico/picture.png"));
            sub0.Action<MenuController>(c => c.MegaMenuUsingPartials(), "Mega-Menu Partials", Url.Content("~/Content/ico/date.png"));
            sub0.Action<MenuController>(c => c.SohTanakaMegaMenuTemplateMenuItem(), "Soh Tanaka Template", Url.Content("~/Content/ico/application_view_gallery.png"));
            sub0.Action<MenuController>(c => c.SohTanakaMegaMenu(), "Soh Tanaka Content", Url.Content("~/Content/ico/layout.png"));
        });
        sub.Link("Vertical", null, Url.Content("~/Content/ico/application_tile_vertical.png")).Items(sub0 => {
            sub0.Action<MenuController>(c => c.VerticalExternal(), "External", Url.Content("~/Content/ico/monitor_go.png"));
            sub0.Action<MenuController>(c => c.VerticalExternal2(), "External 2", Url.Content("~/Content/ico/monitor_link.png"));
        });
        sub.Link("Themed", null, Url.Content("~/Content/ico/image_insert.png")).Items(sub0 => {
            sub0.Action<MenuController>(c => c.SohTanakaMegaMenu(), "Soh Tanaka", Url.Content("~/Content/ico/photo.png"));
            sub0.Action<MenuController>(c => c.JQueryStuff(), "jStuff", Url.Content("~/Content/ico/report.png"));
        });
        sub.Link("Others", null, Url.Content("~/Content/ico/application_side_expand.png")).Items(sub0 => {
            sub0.Action<MenuController>(c => c.External(), "External Links", Url.Content("~/Content/ico/monitor_go.png"));
            sub0.Action<MenuController>(c => c.IconsOne(), "With Icons", Url.Content("~/Content/ico/application_view_tile.png"));
            sub0.Action<MenuController>(c => c.IconsOnly(), "Icons Only", Url.Content("~/Content/ico/application_view_icons.png"));
            sub0.Action<MenuController>(c => c.Disabled(), "Disabled Menu Items", Url.Content("~/Content/ico/disabled.png"));
        });
        sub.Action<MenuController>(c => c.IconsOnly(), "Toolbar", Url.Content("~/Content/ico/wrench.png"));
    });
})
</div>

<script type="text/javascript">
    $(function () {
        // animation options are necessary to avoid IE animation opacity bleeding - caused by IE filtering
        var animationOptions = ($.support.opacity) ? { opacity: 'show', height: 'show'} : { height: 'show' };
        $('ul.sf-menu').superfish({
            hoverClass: 'sfHover',
            delay: 250,
            animation: animationOptions,
            speed: 'fast',
            autoArrows: true,
            dropShadows: true,
            disableHI: true
        });
    });
</script>